package edu.java.lectures.lec15.comparator;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.SortedMap;
import java.util.SortedSet;
import java.util.TreeMap;
import java.util.TreeSet;

public class PersonSortingComparatorTest {
    private static final String LINE = "-----------------------";

    public static void main(String[] args) {
	// Person <- PersonCompareTOByName
	// <- PersonCompareToBySurename

	Person persona1 = new Person("Petyr", "Vasilev", "Petrov", 40,
		Gender.MALE, "Sofiq", 2);
	Person persona2 = new Person("Dimitrichka", "Pencheva", "Nikolova", 32,
		Gender.FEMALE, "Karnobat", 1);
	Person persona3 = new Person("Pencho", "Minchev", "Asenov", 65,
		Gender.MALE, "Blagoevgrad", 3);
	Person persona4 = new Person("Violeta", "Georgieva", "Deneva", 15,
		Gender.FEMALE, "Asenovgrad", 0);
	Person persona5 = new Person("Stoencho", "Borisov", "Dimitrov", 23,
		Gender.MALE, "Montana", 0);

	List<Person> personsList = new ArrayList<Person>();

	personsList.add(persona1);
	personsList.add(persona2);
	personsList.add(persona3);
	personsList.add(persona4);
	personsList.add(persona5);

	System.out.println(LINE);
	for (Person person : personsList) {
	    System.out.println(person);
	}

	Collections.sort(personsList, new PersonFirstNameComparator());

	System.out.println(LINE);
	for (Person person : personsList) {
	    System.out.println(person);
	}

	Collections.sort(personsList, new PersonAgeComparator());

	System.out.println(LINE);
	for (Person person : personsList) {
	    System.out.println(person);
	}

	SortedMap<Person, String> p2sMap = new TreeMap<Person, String>(
		new PersonAgeComparator());

	SortedSet<Person> p2sSet = new TreeSet<Person>(
		new PersonFirstNameComparator());
	
	Collections.bi
    }

}
